import request from '@/utils/request'

// 查询投票管理列表
export function listExhibition(query) {
  return request({
    url: '/exhibition/exhibition/list',
    method: 'get',
    params: query
  })
}

// 查询投票管理详细
export function getExhibition(exhId) {
  return request({
    url: '/exhibition/exhibition/' + exhId,
    method: 'get'
  })
}

// 新增投票管理
export function addExhibition(data) {
  return request({
    url: '/exhibition/exhibition',
    method: 'post',
    data: data
  })
}

// 修改投票管理
export function updateExhibition(data) {
  return request({
    url: '/exhibition/exhibition',
    method: 'put',
    data: data
  })
}

// 删除投票管理
export function delExhibition(exhId) {
  return request({
    url: '/exhibition/exhibition/' + exhId,
    method: 'delete'
  })
}

// 查询所有班级根据校区Id
export function getAllClassList(query) {
  const data = {
    campusId: query
  }
  return request({
    url: '/exhibition/exhibition/selectAllClass',
    method: 'get',
    params: data
  })
}

// 查询所有学生根据班级Id
export function getAllStudentList(query) {
  const data = {
    claId: query
  }
  return request({
    url: '/exhibition/exhibition/selectAllStudent',
    method: 'get',
    params: data
  })
}

// 查询所有作品根据学生Id
export function getAllWorks(query) {
  const data = {
    stuId: query
  }
  return request({
    url: '/exhibition/exhibition/selectAllWorks',
    method: 'get',
    params: data
  })
}


// 提交选中作品
// 查询所有作品根据学生Id
export function insertWorks(data) {

  return request({
    url: '/exhibition/exhibition/insertWorks',
    method: 'post',
    data: data
  })
}
